{extend name="layout:base" /}

{block name="main"}
<div class="col-md-8 offset-md-2 pt-3">
    <div class="card mb-2 {:fm_get_theme()}">
        <h6 class="card-header d-flex justify-content-between">
            <span><i class="fa fa-cog"></i>  {:lng('Settings')}</span>
            <a href="{:addon_url('admin/index/index', ['p' => FM_PATH])}" class="text-danger"><i class="fa fa-times-circle-o"></i> {:lng('Cancel')}</a>
        </h6>
        <div class="card-body">
            <form id="js-settings-form" action="" method="post">
                {:token_field()}
                <div class="form-group row">
                    <label for="js-language" class="col-sm-3 col-form-label">{:lng('Language')}</label>
                    <div class="col-sm-5">
                        <select class="form-select" id="js-language" name="language">
                            <?php
                                foreach ($lang_list as $k => $v) {
                                    echo "<option value='$k' ".(($lang == $k) ? 'selected' : '').">$v</option>";
                                }
                            ?>
                        </select>
                    </div>
                </div>
                <div class="mt-3 mb-3 row ">
                    <label for="error-report" class="col-sm-3 col-form-label"><?php echo lng('ErrorReporting') ?></label>
                    <div class="col-sm-9">
                        <div class="form-check form-switch">
                            <input class="form-check-input" type="checkbox" role="switch" id="error-report" name="error_reporting" value="true" <?php echo $report_errors ? 'checked' : ''; ?> />
                        </div>
                    </div>
                </div>

                <div class="mb-3 row">
                    <label for="js-show-hidden" class="col-sm-3 col-form-label"><?php echo lng('ShowHiddenFiles') ?></label>
                    <div class="col-sm-9">
                        <div class="form-check form-switch">
                            <input class="form-check-input" type="checkbox" role="switch" id="js-show-hidden" name="show_hidden" value="true" <?php echo $show_hidden_files ? 'checked' : ''; ?> />
                        </div>
                    </div>
                </div>

                <div class="mb-3 row">
                    <label for="js-hide-cols" class="col-sm-3 col-form-label"><?php echo lng('HideColumns') ?></label>
                    <div class="col-sm-9">
                        <div class="form-check form-switch">
                            <input class="form-check-input" type="checkbox" role="switch" id="js-hide-cols" name="hide_Cols" value="true" <?php echo $hide_Cols ? 'checked' : ''; ?> />
                        </div>
                    </div>
                </div>

                <div class="mb-3 row">
                    <label  class="col-sm-3 col-form-label">{:lng('Theme')}</label>
                    <div class="col-sm-5">
                        <select class="form-select w-100" id="js-3-0" name="theme">
                            <option value='light' {$fm_theme == "light" ? "selected" : "" }>{:lng('light')}</option>
                            <option value='dark' {$fm_theme == "dark" ? "selected" : "" }>{:lng('dark')}</option>
                        </select>
                    </div>
                </div>
                <div class="mb-3 row">
                    <label  class="col-sm-3 col-form-label">{:lng('Max upload size')}/bytes</label>
                    <div class="col-sm-5">
                        <input type="number" value="{$max_upload_size}" min="0" class="form-control" name="max_upload_size" placeholder="{:lng('Max upload size')}">
                    </div>
                </div>
                <div class="mb-3 row">
                    <label  class="col-sm-3 col-form-label">{:lng('Upload chunk size')}/bytes</label>
                    <div class="col-sm-5">
                        <input value="{$upload_chunk_size}" type="number" min="0" class="form-control" name="upload_chunk_size" placeholder="{:lng('Upload chunk size')}">
                    </div>
                </div>

                <div class="mb-3 row">
                    <div class="col-sm-10">
                        <button type="submit" class="btn btn-primary"> <i class="fa fa-check-circle"></i> {:lng('Save')}</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
{/block}